package gsthrottle

import "time"

func NewWindowThrottle(limitMs time.Duration, tickMs time.Duration) *WindowThrottle {
	return &WindowThrottle{
		tickMs:  tickMs,
		limitMs: limitMs,
		bucket:  map[int64][]uint{},
		tick:    map[int64]uint{},
		limit:   map[int64]uint{},
	}
}

func NewTokenThrottle(rateTimeUnit time.Duration) *TokenThrottle {
	return &TokenThrottle{
		rateTimeUnit: rateTimeUnit,
		maxBucket:    map[int64]uint{},
		bucket:       map[int64]uint{},
		rate:         map[int64]uint{},
	}
}
